<template>
  <view>
    <view class="w100 pl-20 pr-20">
      <view class="w100 p-all-30 bgff br-20 mb-20" v-for="(item,index) in list" :key="index">
        <view class="w100 rowsb rowsm mb-30">
          <view class="fs-30 fw-b col000">{{item.title}}</view>
          <view class="fs-28 fw-b" style="color: #bd3124;" v-if="item.subStatus == 1">未确认</view>
          <view class="fs-28 fw-b" style="color: #3ab567;" v-if="item.subStatus == 2">已确认</view>
        </view>
        <view class="">{{item.content}}</view>
        <view class="w100 rowsb rowsm mt-20">
          <view class="fs-24 col333">{{item.stName}}</view>
          <view class="fs-24 col888">{{item.createTime}}</view>      
        </view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        list:[],
         total:0,
        limit: {
          pageNum: 1,
          pageSize: 10
        },
      };
    },
    onLoad() {
      this.getList()
    },
    // 下拉到底部后加载新数据
    onReachBottom() {
      if (this.list.length < this.total) {
        this.limit.pageNum++;
        this.getList()
      }
    },
    onPullDownRefresh() {
      this.limit.pageNum = 1
      this.getList()
    },
    methods:{
      getList(){
        this.$tools.axiosFromToken('POST',`prouserdc/listLsDc?pageNum=${this.limit.pageNum}&pageSize=${this.limit.pageSize}`,{},'加载中').then(res => {
          if(res.code != 200) return this.$tools.showtt(res.msg)
           this.total = res.total
            if (this.limit.pageNum == 1) {
              this.list = res.rows;
            } else {
              this.list = [...this.list, ...res.rows];
            }
        })
      }
    }
  }
</script>

<style lang="scss">

</style>
